/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.fee.entity.OpenInvoiceDetail;
import com.jeeplus.modules.fee.mapper.OpenInvoiceDetailMapper;

/**
 * 应开发票子表Service
 * @author weisong
 * @version 2017-09-22
 */
@Service
@Transactional(readOnly = true)
public class OpenInvoiceDetailService extends CrudService<OpenInvoiceDetailMapper, OpenInvoiceDetail> {

	public OpenInvoiceDetail get(String id) {
		return super.get(id);
	}
	
	public List<OpenInvoiceDetail> findList(OpenInvoiceDetail openInvoiceDetail) {
		return super.findList(openInvoiceDetail);
	}
	
	public Page<OpenInvoiceDetail> findPage(Page<OpenInvoiceDetail> page, OpenInvoiceDetail openInvoiceDetail) {
		return super.findPage(page, openInvoiceDetail);
	}
	
	@Transactional(readOnly = false)
	public void save(OpenInvoiceDetail openInvoiceDetail) {
		super.save(openInvoiceDetail);
	}
	
	@Transactional(readOnly = false)
	public void delete(OpenInvoiceDetail openInvoiceDetail) {
		super.delete(openInvoiceDetail);
	}
	//回填应收结算单的开票金额
	public List<OpenInvoiceDetail> findOpenInvoiceMoney(String id) {
		return mapper.findOpenInvoiceMoney(id);
	}

	//关联应收发票与应收发票明细表
	public List<OpenInvoiceDetail> findOpenInvoiceDetailById(String id) {
		return mapper.findOpenInvoiceDetailById(id);
	}

	//根据结算单id和发票id获取发票子表
	public OpenInvoiceDetail findAllByReceivableId(String receId ,String invoiceId ){
		return mapper.findAllByReceivableId(receId , invoiceId);
	}
}